In [1]:
import plotly
import plotly.figure_factory as ff
plotly.offline.init_notebook_mode()
import cufflinks as cf
cf.go_offline()
cf.set_config_file(theme='ggplot')
In [2]:
import pandas as pd
import numpy as np
In [3]:
x = np.random.randn(1000)  
hist_data = [x]
group_labels = ['distplot']
In [4]:
fig = ff.create_distplot(hist_data, group_labels)
In [5]:
plotly.offline.iplot(fig, filename='Basic Distplot')

Mulitple plot

In [6]:
# Add histogram data
x1 = np.random.randn(200)-2  
x2 = np.random.randn(200)  
x3 = np.random.randn(200)+2  
x4 = np.random.randn(200)+4  

# Group data together
hist_data = [x1, x2, x3, x4]

group_labels = ['Group 1', 'Group 2', 'Group 3', 'Group 4']

# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, bin_size=.2)
In [7]:
plotly.offline.iplot(fig)